﻿using UnityEngine;
using System.Collections;
using System.Collections.Generic;


public class ListUtils {

	public static  void shuffle<T> (List<T> list) {
		for (int i = 0; i < list.Count; i++) {
			T temp = list[i];
			int randomIndex = Random.Range(i, list.Count);
			list[i] = list[randomIndex];
			list[randomIndex] = temp;
		}
	}

	public static  void shuffle<T> (T[] list) {
		for (int i = 0; i < list.Length; i++) {
			T temp = list[i];
			int randomIndex = Random.Range(i, list.Length);
			list[i] = list[randomIndex];
			list[randomIndex] = temp;
		}
	}
}
